package com.itheima.homework15;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class Test02 {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds=new DatagramSocket(10086);
       byte [] bytes=new byte[1024];
        DatagramPacket dp=new DatagramPacket(bytes,0,bytes.length);
        ds.receive(dp);
        InetAddress address = InetAddress.getByName("192.168.13.24");
        System.out.println(address.getHostAddress()+"说："+new String(bytes,0,bytes.length));
    }
}
